import {
  Toast
} from "vant";
import cTitle from "components/title";

export default {
  data() {
    return {
      list: {},
      page: 1, // 初始页码
      total_page: 0,
      isLoadMore: true,
      id: ''
    };
  },

  components: {
    cTitle
  },
  activated() {
    console.log('kkkkkkkkk', this.$route.params.id)
    this.id = this.$route.params.id
    console.log(localStorage.getItem("uid"), 'uid')
    if (!localStorage.getItem("uid")) {
      this.$router.push(this.fun.getUrl("member"));
      return
    }
      this.getData();
  },
  computed: {

  },

  methods: {
    formatTimestamp(timestamp) {  
        if(!timestamp){
            return
        }
        // 创建一个新的Date对象  
        const date = new Date(timestamp * 1000); // 因为时间戳是秒，需要乘以1000转换为毫秒  
      
        // 获取年、月、日、小时、分钟、秒  
        const year = date.getFullYear();  
        const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始，需要加1  
        const day = String(date.getDate()).padStart(2, '0');  
        const hours = String(date.getHours()).padStart(2, '0');  
        const minutes = String(date.getMinutes()).padStart(2, '0');  
        const seconds = String(date.getSeconds()).padStart(2, '0');  
      
        // 拼接成所需的格式  
        const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;  
      
        return formattedDate;  
    },  
   
    getData() {
      $http.get("ZhengChengYc.commisionInfo", {
        id: this.id
      }, "加载中").then((res) => {
        if (res.result == 1) {
          console.log(res,'jsjsjsjsj')
            this.list = res.data;
        } else {
          
        }
      });
    },
   

  }
};